package dynamic_state;

import java.lang.reflect.Proxy;

/**
 * @Classname TestDynamicState
 * @Description TODO
 * @Date 2023/9/1 17:52
 * @Created by wpc
 */
public class TestDynamicState {
    public static void main(String[] args) {
        StartSkill startSkill = new Star();
        ProxyCenter proxyCenter = new ProxyCenter(startSkill);

        StartSkill proxStar = (StartSkill) Proxy.newProxyInstance(
                startSkill.getClass().getClassLoader(),
                startSkill.getClass().getInterfaces(),
                proxyCenter
        );
        proxStar.sing();
    }
}
